package com.api.league.dao;

import com.api.core.ApiMapper;
import com.api.league.model.LeagueFixture;
import com.api.league.vo.LeagueFixtureVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author RenQiang
 * @date 2021/5/30
 */
@Mapper
public interface LeagueFixtureMapper extends ApiMapper<LeagueFixture> {
    /**
     * 分页查询对局
     *
     * @param leagueId
     * @return
     */
    List<LeagueFixtureVo> findFixtureByPage(@Param("leagueId") Long leagueId);

    /**
     * 保存对局结果
     *
     * @param fixtureId
     * @param team1Score
     * @param team2Score
     * @return
     */
    int saveResult(@Param("fixtureId") Long fixtureId, @Param("team1Score") Integer team1Score, @Param("team2Score") Integer team2Score);

    void deleteByLeagueId(@Param("leagueId") Long leagueId);
}
